GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mysql_backup
CONFIG_FILE=configs/config.yaml

# Directories
CMD_DIR=cmd

all: build

build: 
        $(GOBUILD) -o $(BINARY_NAME) $(CMD_DIR)/main.go
        rm -rf ./xtrabackup_backupfiles

clean: 
        $(GOCLEAN)
        rm -rf $(BINARY_NAME)
        rm -rf ./xtrabackup_backupfiles

run:  build
        ./$(BINARY_NAME) $(CONFIG_FILE)
        rm -rf ./xtrabackup_backupfiles